﻿using System.Collections.Generic;

namespace isct.escada.domain.core.DeviceDriver
{
    public interface IBasicDriver
    {
        int Connect(Dictionary<string, string> prmConnectionArgs);
        int Disconnect();

        EBasicDriverStatus Status { get; set; }

        IDeviceObjectStatus ReadObject(IDeviceObjectInfo prmDeviceObjectDef);
        IWriteError WriteObject(IDeviceObjectInfo prmDeviceObjectDef, IDeviceObjectStatus prmDeviceObjectStatus);

        IEnumerable<IDeviceObjectStatus> ReadObjects(IEnumerable<IDeviceObjectInfo> prmDeviceObjectDef);
        IEnumerable<IWriteError> WriteObjects(IDictionary<IDeviceObjectInfo, IDeviceObjectStatus>  prmDeviceAfectedObjects);

        int RegisterObjects(IEnumerable<IDeviceObjectInfo> prmDeviceObjectDef, BasicDriverRegisteredObjectCallbak prmCallback);
    }
    public enum EBasicDriverStatus
    {
        Unknow=-1,
        Connected=1,
        Disconnected=0,
        WithErrors=2
    }
}
